package com.yb.java.singleton;

/**
 * @program: design-pattern
 * @description: 懒汉式单例模式，线程不安全。第一次调用的时候初始化，节约资源，但是不能在多线程中使用。
 * @author: Mr.Bo
 * @create: 2021-04-25 20:40
 **/
public class LazyManNoSingleton {

    private static LazyManNoSingleton instance;

    private LazyManNoSingleton() {
    }

    public static LazyManNoSingleton getInstance(){
        if (instance == null){
            instance = new LazyManNoSingleton();
        }
        return instance;
    }
}
